# HP OpenView Service Desk

## version 4.5

## Custom Codes

September 2006

© Copyright 2005 Hewlett-Packard Development Company, L.P.

## Content:

1. Last-minute information
2. Introduction
3. Manage Custom Codes
3.1 Custom code definition
3.2 Custom field refer to code
3.3 Custom Code value
4. Enhanced Auditing for Custom Codes
4.1 Audit Custom Code
4.2 Audit Custom Code values
5. Localization
6. Web-API
7. Technical information

## LAST-MINUTE INFORMATION

There is no last-minute information.

## INTRODUCTION

Since Service Desk SP18, Service Desk allows user to create additional custom fields, but it is not possible to create a code field which refers to an entirely new code type. Custom Codes feature comes as an add-on feature to 'Unlimited Custom Fields' feature and aims at resolving this issue. With this feature, user can introduce new code type and make it being referred by a custom field. This new code type is called Custom Code. This document describes how to manage Custom Codes, what you need to take into account when managing Custom Codes and how to use a Custom Code.

The main audience for this document is Service Desk administrators authorized to configure Custom Codes and custom fields.

## Managing Custom Codes

### Custom Codes definition

#### View of Custom Codes

In Service Desk Administrator Console, a new node 'Custom Code' has been added under hp OpenView Service Desk > Data node, it is only applicable for a Service Desk system administrator. Click this node, all Custom Codes will be shown in a table view in the right data pane. Three views are currently available for this node. they are

- Custom Code (System) - Custom Code view without grouping (See Figure 1)
- Custom Codes by Category (System) - Custom Code view grouped by Category field (See Figure 2)
- Custom Codes by Type (System) - Custom Code view grouped by Type field (See Figure 3)

Figure 1 - Custom Code View 1

By default, the view 'Custom Code (System)' is used.

Table 1 shows the detailed descriptions of all the fields in Custom Code view.

| Field Name | Description
1 | Name Label | The localized Custom Code name
2 | Name Label Key | Key of the name label, it will be used as part of the Web API class name
3 | Comment | Comment of the this Custom Code
4 | Icon | The icon of this Custom Code
5 | Type | Code type, Ordered or Hierarchical. Code values of an Ordered code can be displayed in a table view in order (e.g. Category), whereas code values of a Hierarchical code can be shown in a tree view (e.g. Priority).
6 | Category | Calculated field. Its value will be the name of a master Item (Service call, Incident and Problem etc.) or General, If this Custom Code is only referred by an Item, the name of this Item will be the category value of this Custom Code, otherwise, the category value will be General.
7 | Blocked | Calculated field, unchecked when at least one custom fields which refer to this Custom Code are activated, or otherwise

Table 1 - Field Descriptions

Figure 2 - Custom Code View 2

Figure 3 - Custom Code View 3

#### Add a new Custom Code

Open the Administrator Console, and navigate to Data > Custom Code (see Figure 1), click the File > New menu item, or select the "New Custom Code" option from the context menu (which you see when you right-click on an item in the view). This opens the New Custom Code data form. In principle, there are two main types of Custom Code

- Ordered Custom Code - Code values will be shown in a table view in order.
- Hierarchical Custom Code - Code values can be shown in a tree view.

The screenshot below shows new Custom Code data form.

Figure 4

To define a Custom Code do the following:

1. Select the type
2. Fill the Key field, it is recommended that user DOES NOT use non-Latin text as a part of the Key value. Note: Value of Key field should be unique with other entity.
3. Fill Text field which is actually the name of Custom Code.
4. Select an Icon (optional), it explores icons in <SD_INSTALL_DIR>/client/images, it is recommended that user pick up an icon which is distributed originally with the product. Otherwise, the service desk administrator should distribute this icon to all Service Desk Clients manually, and place it in the same directory.
5. Fill Comment field (optional)
6. Click Save and Close toolbar button to save the Custom Code, or click Close window button to cancel the operation. If the Field Key name is already in use, a dialog box (see Figure 5) informs you that the operation has failed.
7. After creating a Custom Code, default value of field "Category" will be "General" which means there is no reference with Custom Filed and the Custom Code is "Blocked" by default.

Figure 5

#### Edit a Custom Code

In Administrator Console, navigate to Data > Custom Code, select a Custom Code record, click File > Open menu item, Open toolbar button or select the "Open" option from the right-click pop-up context menu. This opens the selected Custom Code. In the opened form (See Figure 6), the Type and Key fields are shown as read-only, other fields are editable.

Note: User should restart both Service Desk server and client after adding or modifying Custom Code.

Figure 6

#### Delete a Custom Code

A Custom Code is removable if it has not been referred by a custom field. To remove a Custom Code, click the Delete toolbar button or 'Delete' option from the right-click pop-up context menu. If the selected Custom Code is never referred by any custom field, deletion operation will succeed, otherwise, a dialog which reports all the references will display (See Figure 7).

Figure 7

### Custom Field refer to a Custom Code

A Custom Code can be referred by a custom field in any master item and there is no inner logic to control a Custom Code to be only referred by a specific master item. A Service Desk system administrator should be aware of that when introducing a custom field. In the view Custom Codes by Category (See Figure 2), if a Custom Code is not placed in General category, this Custom Code must has been referred by the Item which has the same name with the category name. It's highly recommended to consider circumspectly about whether this Custom Code can be referred by a custom field before referring it. A simple way to check whether this Custom Code has been referred by a custom field is

1. Open the Custom Code ( See Figure 6)
2. In the opened form, click Actions > References ... menu item from the menu bar. This will open a dialog and report all the references (See Figure 8), Open the reference record to see the detailed information.
3. After being referred to a Custom Field, the Custom Code will not be "Blocked". The "Category" value of the Custom Code depends on the number of entity refer to it. If only one entity refers to the code, "Category" is specific entity (e.g. "Service call"); if more than one entity refer to the same code "Category" is "General".

Note: You should refresh the Custom Code View to make update in effect.

Figure 8

Using a custom field which refers to a new Custom Code has no difference with using other custom fields. The functionality of activating or deactivating a custom field remains unchanged. The newly introduced code field can be used in Form, View, Templates, Advanced Find, DB Rule and UI Rule etc.

### Manage Custom Code values

Code values of a Custom Code become operable only after this Custom Code is referred by at least one active custom field. There is no change for functionality of managing Custom Code values, code values of a Custom Code and an existing Code are both manipulated under the node hp OpenView service desk > Data > Codes. To maintain Custom Code values, do the following:

1. First, navigate to hp OpenView service desk > Data > Custom Code node, switch to Custom Code by category view to see if the Custom Code is not blocked, which category it belongs to.
2. For a non-blocked Custom Code, according to which category it belongs to, a new node name by the name of this Custom Code will be shown under hp OpenView service desk > Data > Codes > <Category Name>.
3. Enter this node, user can manage code values of this Custom Code.

Note: You should refresh the Custom Code value View to make update in effect.

## Enhanced Auditing for Custom Code

In principle, Enhanced Auditing for Custom Code includes two parts

1. Audit Custom Code
2. Audit Custom Code values

### Audit Custom Code

The manipulation of Custom Code can be audited with Enhanced Auditing. To audit Custom Code, do the following:

1. In Administrator Console, navigate to Security > Enhanced Auditing > Configuration, right click hp OpenView service desk node in the right tree view data pane and press the Resume option from the pop-up menu.
2. Expand the hp OpenView service desk node and navigate to Data > Custom Code, enable auditing (See Figure 9).

Figure 9

Then the operation of Custom Code creating, editing and deleting will be audited.

NOTE: The way this feature deal with auditing delete operation is different from other parts. For other parts, auditing delete operation is managed by the audit configuration node hp OpenView service desk - deletion > Items.

### Audit Custom Code Values

Custom Code values auditing is the same as the auditing of code values of existing Codes. Enable auditing for hp OpenView service desk > Data > Codes, then the operation of creating and modifying Custom Code values will be audited, but deleting a Custom Code value will not be audited until the audit configuration node hp OpenView service desk - deletion > Items ( See Figure 10) is checked.

Figure 10

## Custom Code ACES

Since Service Desk SP18, a Service Desk system administrator is capable of migrating custom fields from staging to a production environment. If a custom field happens to be referred a Custom Code, the ACES importing processing for this custom field must fail before the Custom Code is imported. Custom Code ACES is provided for transferring Custom Codes between two Service Desk instances with the same version.

The exported XML only includes definition of Custom Code and code values of Custom Code are not included, ACES for code values of custom codes behaves without any difference from it does for values of original codes. When performing ACES exporting, user should separate the task into three groups: Custom Code, Custom Field and Custom Code value.

When importing Custom Codes using ACES, make sure that the option "Overwrite Existing Items" is checked if you want these existing Custom Codes to be updated. Note that overriding existing items behaves the same as it does in custom field ACES.

To avoid problems that come from missing Custom Codes when processing custom field ACES importing, user MUST process Custom Code ACES importing prior to process custom field ACES importing.

Custom Code ACES importing changes the Object Model of Service Desk, this is as same as it does in custom field ACES importing.

Note: Custom Code ACES importing, which means that restarting both Service Desk server and client is required if user want to import Custom Code values right after importing the Custom Codes by ACES.

## Localization

I18N (Internationalization) of Custom Codes feature includes two parts, one is internationalization for Custom Code name and the other is for Custom Code values. They are done in hp OpenView service desk > Presentation > Localized Text > Label Text and hp OpenView service desk > Presentation > Localized Text > Kernel Code Text respectively.

## Web-API

To access newly added custom code using the Web API, Java developers need to regenerate the Web API, compile it, and replace the original Web API jar file with the new Web API jar file in their Java applications. This function has been implemented in ITSM008292. Please refer to ITSM00 8292 for more information.

## Technical information

- Object model changed. In current Service Desk, the Code Items referred by pre-defined custom fields are all inherited from Code ordered which is defined in ITSM module, but all new custom codes are indirectly inherited from Kernel Code.
- No table added. It does not need to create new data mapping after a Custom Code created. Whereas code values of new custom codes will be stored in table REP_CODES and REP_CODES_TEXT